import { occtimportjs } from "../plugins/js"
import wasm from "../plugins/js/occt/occt-import-js.wasm?url"
async function LoadGeometry(filePath: string) {
    const occt = await occtimportjs({
        locateFile: () => wasm
    })

    const response = await fetch(filePath)
    const arrayBuffer = await response.arrayBuffer()
    const buffer = new Uint8Array(arrayBuffer)
    const result = occt.ReadStepFile(buffer,null)
    return result
}
self.onmessage = async ({data}) => {
    const filePath=data.filePath

    const result=await LoadGeometry(filePath)

    self.postMessage({data:result})
}